home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.3 / EnterFile.3 < prev    next >
Text File  |  1995-07-25  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333))))            TTTTccccllll ((((7777....0000))))            TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           Tcl_EnterFile,   Tcl_GetOpenFile,   Tcl_FilePermissions    -
  12.           manipulate the table of open files
  13.  
  14.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.           ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  16.  
  17.           TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee(_i_n_t_e_r_p, _f_i_l_e, _p_e_r_m_i_s_s_i_o_n_s)
  18.  
  19.           int
  20.           TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee(_i_n_t_e_r_p, _s_t_r_i_n_g, _w_r_i_t_e, _c_h_e_c_k_U_s_a_g_e, _f_i_l_e_P_t_r)
  21.  
  22.           int
  23.           TTTTccccllll____FFFFiiiilllleeeePPPPeeeerrrrmmmmiiiissssssssiiiioooonnnnssss((((_f_i_l_e)
  24.  
  25.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  26.           Tcl_Interp   *_i_n_t_e_r_p      (in)      Tcl   interpreter   from
  27.                                               which   file  is  to  be
  28.                                               accessed.
  29.  
  30.           FILE         *_f_i_l_e        (in)      Handle for file that  is
  31.                                               to  become accessible in
  32.                                               _i_n_t_e_r_p.
  33.  
  34.           int          _p_e_r_m_i_s_s_i_o_n_s  (in)      OR-ed   combination   of
  35.                                               TCL_FILE_READABLE    and
  36.                                               TCL_FILE_WRITABLE;
  37.                                               indicates  whether  _f_i_l_e
  38.                                               was opened  for  reading
  39.                                               or writing or both.
  40.  
  41.           char         *_s_t_r_i_n_g      (in)      String identifying file,
  42.                                               such as ssssttttddddiiiinnnn or ffffiiiilllleeee4444.
  43.  
  44.           int          _w_r_i_t_e        (in)      Non-zero means the  file
  45.                                               will    be    used   for
  46.                                               writing, zero  means  it
  47.                                               will    be    used   for
  48.                                               reading.
  49.  
  50.           int          _c_h_e_c_k_U_s_a_g_e   (in)      If  non-zero,  then   an
  51.                                               error  will be generated
  52.                                               if   the   file   wasn't
  53.                                               opened  for  the  access
  54.                                               indicated by _w_r_i_t_e.
  55.  
  56.           FILE         **_f_i_l_e_P_t_r    (out)     Points to word in  which
  57.                                               to store pointer to FILE
  58.                                               structure for  the  file
  59.                                               given by _s_t_r_i_n_g.
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/10/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333))))            TTTTccccllll ((((7777....0000))))            TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee((((3333))))
  71.  
  72.  
  73.  
  74.      _________________________________________________________________
  75.  
  76.  
  77.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  78.           These  procedures  provide  access  to  Tcl's  file   naming
  79.           mechanism.   TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee  enters  an  open file into Tcl's
  80.           file table so that it can be  accessed  using  Tcl  commands
  81.           like  ggggeeeettttssss,  ppppuuuuttttssss,  sssseeeeeeeekkkk,  and cccclllloooosssseeee.  It returns in _i_n_t_e_r_p-
  82.           >_r_e_s_u_l_t an identifier such as ffffiiiilllleeee4444  that  can  be  used  to
  83.           refer to the file in subsequent Tcl commands.  TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee
  84.           is typically used to implement new Tcl  commands  that  open
  85.           sockets,   pipes,  or  other  kinds  of  files  not  already
  86.           supported by the built-in commands.
  87.  
  88.           TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee takes as argument a file identifier  of  the
  89.           form  returned  by  the  ooooppppeeeennnn  command  or TTTTccccllll____EEEEnnnntttteeeerrrrFFFFiiiilllleeee and
  90.           returns at *_f_i_l_e_P_t_r a pointer to the FILE structure for  the
  91.           file.  The _w_r_i_t_e argument indicates whether the FILE pointer
  92.           will be used for reading or writing.  In some cases, such as
  93.           a   file  that  connects  to  a  pipeline  of  subprocesses,
  94.           different FILE pointers will be  returned  for  reading  and
  95.           writing.   TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee  normally  returns TCL_OK.  If an
  96.           error occurs in TTTTccccllll____GGGGeeeettttOOOOppppeeeennnnFFFFiiiilllleeee (e.g. _s_t_r_i_n_g didn't make any
  97.           sense  or  _c_h_e_c_k_U_s_a_g_e was set and the file wasn't opened for
  98.           the access specified by _w_r_i_t_e) then  TCL_ERROR  is  returned
  99.           and  _i_n_t_e_r_p->_r_e_s_u_l_t  will  contain  an  error  message.   If
  100.           _c_h_e_c_k_U_s_a_g_e is zero and the file wasn't opened for the access
  101.           specified  by  _w_r_i_t_e,  then  the  FILE  pointer  returned at
  102.           *_f_i_l_e_P_t_r may not correspond to _w_r_i_t_e.
  103.  
  104.           TTTTccccllll____FFFFiiiilllleeeePPPPeeeerrrrmmmmiiiissssssssiiiioooonnnnssss returns an OR-ed combination of the mask
  105.           bits TCL_FILE_READABLE and TCL_FILE_WRITABLE; these indicate
  106.           whether the given file was opened for reading or writing  or
  107.           both.   If _f_i_l_e does not refer to a file in Tcl's file table
  108.           then -1 is returned.
  109.  
  110.  
  111.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  112.           file table, permissions, pipeline, read, write
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/10/95)
  130.  
  131.  
  132.  
  133.